@echo off

set DOCKER_HOST=http://192.168.1.63:2375

set INSTALL_PATH=%~dp0

echo INSTALL_PATH:%INSTALL_PATH%


call :install_core

cd %INSTALL_PATH%

call :install_all

cd %INSTALL_PATH%

call :build_consumer

cd %INSTALL_PATH%

call :build_loader

cd %INSTALL_PATH%

call :build_monitor

cd %INSTALL_PATH%

exit /b


:install_core
(
  cd ../mqbd
    set "METHOD_NAME=%~n0_method"
    mvn   clean install   -DskipTests -P prop
)
 
:install_all
(
    set "METHOD_NAME=%~n0_method"
    mvn   clean install   -DskipTests -P test
   
)

:build_consumer
(
   set "METHOD_NAME=%~n0_method"
   echo %METHOD_NAME%
   cd ./mqbd-consumer
   mvn   clean install  -DskipTests -P test  com.spotify:dockerfile-maven-plugin:1.4.13:build
)

:build_loader
(
   set "METHOD_NAME=%~n0_method"
   echo %METHOD_NAME%
   cd ./mqbd-loader
   mvn   clean install  -DskipTests -P test  com.spotify:dockerfile-maven-plugin:1.4.13:build
)

:build_monitor
(
   set "METHOD_NAME=%~n0_method"
   echo %METHOD_NAME%
   cd ./mqbd-monitor
   mvn   clean install  -DskipTests -P test  com.spotify:dockerfile-maven-plugin:1.4.13:build
)


